home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 018a / macade.zip / MCOMPILE.DOC < prev    next >
Text File  |  1991-12-07  |  14KB  |  296 lines

  1.  
  2.                            MCompile.exe
  3.               A Utility for Compiling ASCII Text File
  4.                 Listings of WordPerfect 5.1 Macros
  5.                 into Executable Macro (.wpm) Files
  6.  
  7.                                 by
  8.  
  9.                       Jeffrey S. Kane, Ph.D.
  10.                 Performance Sciences International
  11.                           Summerfield, NC
  12.  
  13. 1.   Read the REGISTER.doc, LICENSE.doc, and WARRANTY.doc files distributed
  14.      with this macro.
  15.  
  16. 2.   Requires:
  17.      
  18.      A.   WordPerfect 5.1 (for use of compiled macros)
  19.  
  20.      B.   MS/PC-DOS 3.0 or higher
  21.  
  22.      C.   An ASCII source file that conforms to the compiler's
  23.           structure and syntax specifications.
  24.  
  25. 3.   Features:
  26.  
  27.      A.   Fast    (e.g., less than 4 seconds for a 10K source file
  28.           on 386DX-20 machine).
  29.  
  30.  
  31.      B.   Compact .exe file size (<10.8 KBytes)
  32.  
  33.      C.   Accurate
  34.  
  35.      D.   Powerful: accepts source files of unlimited size.
  36.  
  37.      E.   Handles either spaces or tabs as formatting characters
  38.           at the beginnings of lines (up to first significant
  39.           character on any line).
  40.  
  41.      F.   Case insensitive: accepts commands in whatever case you
  42.           feel like entering them.
  43.  
  44. 4.   Installation:
  45.  
  46.      No installation is required other than to copy the
  47.      MCompile.exe file to the directory where your WordPerfect
  48.      macros reside.  As in the case of Macrolst, we recommend
  49.      locating MCompile in this directory at least for the sake of
  50.      convenience, and of necessity if you plan to use the EditM
  51.      or EditWP system for editing macros.
  52.  
  53. 5.   Operation:
  54.  
  55.      A.   Structure of Source Files
  56.  
  57.                ASCII text file listings of macros, which we'll
  58.           refer to as source files from this point onward, must
  59.           conform to an easily achieved structure in order to be
  60.           successfully compiled.  The structure of a source file
  61.           consists of three separate components, as follows:
  62.  
  63.           1)   Header:  all characters from the start of the file
  64.            to the 'STARTMACRO:' code delimiter.
  65.           2)   Code Delimiter:  the word 'STARTMACRO:', including
  66.                its terminating colon.
  67.           3)   Source Code:  all characters from the end of the
  68.                code delimiter to the end of the file.
  69.  
  70.                The compiler will first search through the Header to
  71.           find the phrase,
  72.  
  73.               Macro Description:
  74.  
  75.       All the characters up to a maximum of 39 that occur between
  76.       the colon at the end of the above phrase and the first end of
  77.       line sequence (ASCII 13ASCII 10, produced by pressing your
  78.       [ENTER] key) encountered before the beginning of the
  79.       'STARTMACRO:' code delimiter will be used as the macro
  80.       description.    Thus, if you intend there to be no description
  81.       for the macro, either leave out the 'Macro Description:'
  82.       phrase altogether, or follow it with an immediate press of
  83.       your [ENTER] key.
  84.  
  85.                The compiler then looks for the 'STARTMACRO:' code
  86.           delimiter.  This delimiter MUST appear before the start
  87.           of the source code, or no compilation will occur.  Every
  88.           character after the code delimiter to the end of the
  89.           source file will be compiled into macro code.
  90.  
  91.                To generate an example of how the structure of a
  92.           source file should look, use the Macrolst program to
  93.           create a source file from one of your existing macros. 
  94.           Macrolst creates files which are directly recompilable
  95.           back to macros (i.e., .wpm files).
  96.  
  97.      B.   Syntax of Source Files
  98.  
  99.       1)   All macro and keystroke commands must begin with an
  100.            opening French brace ({) and end with a closing
  101.            French brace (}).
  102.  
  103.       2)   In earlier versions of MacroAde the MCompile program
  104.            required that the case (i.e., upper or lower) of every
  105.            letter between the braces in all macro and keystroke
  106.            commands exactly match that used in the display format
  107.            of the commands.  However, several macro enthusiasts
  108.            have suggested that the goal of any external editing
  109.            capability is ease of use.  To have to observe the
  110.            proper case of command characters conflicts with that
  111.            goal.  Consequently, in this version any mix of cases
  112.            may be used in entering any command.  However, MacroLst
  113.            will continue to translate the commands in a macro in
  114.            accordance with WordPerfect's case format conventions.
  115.            in WordPerfect.
  116.  
  117.       3)   Most of the macro commands are listed and explained in
  118.            detail in Appendix K of the WordPerfect 5.1 manual.
  119.            The complete list of the commands is presentedd for
  120.            syntax reference purposes in the COMMANDS.ref file
  121.            contained in the MacroAde package.
  122.  
  123.       4)   WordPerfect furnishes no list of the keystroke commands
  124.            in the form in which they actually appear in WordPerfect's
  125.            macro editor.  MacroAde provides the needed list of these
  126.            commands in their correct form in its COMMANDS.ref file,
  127.            following the list of macro commands.  Next to each
  128.            keystroke command its WordPerfect code is listed,
  129.            which is needed for some macro commands.  These
  130.            commands must be entered exactly as they appear in
  131.            this list EXCEPT for their case or a syntax error will
  132.            occur and halt compilation.
  133.  
  134.       5)   One special syntax rule that is unique to creating
  135.                source files compilable by MCompile concerns the
  136.                manner in which non-keyboard characters are entered
  137.                to correspond to the use of WordPerfect's 'Compose'
  138.                feature.  This feature is used to access characters
  139.                in WordPerfect character sets above Set 0 (i.e.,
  140.                Sets 1-12), although it can also be used for Set 0
  141.            if there is some reason to do so (e.g., see below for
  142.            the special case of specifying braces as literal
  143.            characters, not parts of commands).  You can specify
  144.                any of these characters in the 13 Character Sets
  145.                (see Appendix P of WordPerfect manual) by entering
  146.            its code using the following syntax:
  147.  
  148.                     [:S,C]
  149.                where:
  150.  
  151.                      S =  the WordPerfect Character Set number (0-
  152.                           12)
  153.                      C =  the number of the character within the
  154.                           specified Character Set
  155.                For example, to specify the copyright symbol, which
  156.                is character 23 in set 4, you could enter:
  157.  
  158.                     [:4,23]
  159.  
  160.            NOTE: Even though the compiler accepts certain high
  161.            ASCII codes in the above form (e.g., [:0,250]) for
  162.            various purposes in the construction of .wpm files,
  163.            do not use any other high ASCII characters (i.e., >126)
  164.            in your macro if they aren't specifically allowed in
  165.            these instructions.  WordPerfect's character set 0 only
  166.            contains the first 126 ASCII characters; use of others
  167.            not authorized here will not be recognized in WordPerfect.
  168.  
  169.           6)   The easiest approach to handling spaces and tabs in the
  170.                compilation process would be to merely interpret them
  171.                directly.  However, this approach would make it very
  172.                difficult to use editors which expand all tabs into spaces.
  173.                One of the most widely used editors--QEDIT--offers a choice
  174.                of either the latter sort of tab expansion or a literal
  175.                treatment of tabs which displays the tab character but
  176.                doesn't execute it.  The result of the latter approach is
  177.                a very unreadable display since none of the indentation
  178.                actually appears.  The tab expansion option produces a
  179.                readable display but eliminates all the tabs, which would
  180.                leave the compiled macro without any indentation formatting.
  181.                This can be slightly alleviated by using QEDIT's Tabs Out
  182.                configuration option, but that only applies to new lines
  183.                inserted in a macro and only deals with space sequences of
  184.                one fixed length.  A similar problem arises in using the
  185.                EDITWP macro to edit macros as WordPerfect documents.  This
  186.                macro saves the documents via WordPerfect's Text Out feature,
  187.                which converts all tabs to spaces, thereby eliminating all
  188.                indentation formatting information if the compiler were
  189.                designed to interpret all spaces literally.  Clearly, an
  190.                approach other than literal interpretation of tabs and
  191.                spaces is needed.
  192.  
  193.                MCompile intelligently parses all instances of the space
  194.                character into either tabs or literal spaces.  This enables
  195.                MacroLst to produce source files using the expansion of tabs
  196.                to spaces (ASCII 32) that are highly readable in any editor.
  197.                MCompile will then convert all sequences of 3 or 4 spaces
  198.                back to tabs.
  199.  
  200.                The cost of this approach is that with one exception, all
  201.                spaces intended to be retained as literal spaces within
  202.                the macro must be represented by the ASCII 250 character
  203.                or by the [:0,250] character code (if your editor won't
  204.                represent ASCII 250).  The exception is any space that occurs
  205.                between two characters that are neither space (i.e., ASCII 32)
  206.                nor tab (i.e., ASCII 9) characters, and that doesn't occur at
  207.                the very start of a line, as in a space that separates two
  208.                words in a comment.  These singly-occurring spaces will be
  209.                compiled as literal spaces in the macro.
  210.  
  211.                Many editors offer a keyboard macro capability that will
  212.                make the use of ASCII 250 much easier.  For example, in
  213.                QEDIT you can simply edit your keyboard configuration file
  214.                (QCONFIG.DAT is its default name if you haven't renamed it)
  215.                and assign the following line to any key that you want to
  216.                use for ASCII 250:
  217.  
  218.                                 macro_begin '·'
  219.  
  220.                The character between the single quotes is ASCII 250, which
  221.                you can access in QEDIT by holding down the ALT key and
  222.                typing 250 on the numeric keypad (actually, on my keyboard
  223.                I have to hold down both CTRL and ALT).  Once you've changed
  224.                the keyboard configuration file, you'll then have to run
  225.                the QCONFIG.EXE program, select the Keys option, and then save
  226.                the setup in order for the new key assignment to take effect.
  227.  
  228.           7)   If you need to continue a line containing a sequence of
  229.                literal spaces (i.e., spaces that actually need to be in
  230.                the macro) in such a manner that would cause one of the
  231.                literal spaces to start the next line, and for some reason
  232.                you cannot use the ASCII 250 character (e.g., your editor
  233.                won't allow you access to it), then represent it and all
  234.                other such literal spaces with the [:0,250] character code.
  235.  
  236.           8)   If your editor converts tabs to spaces (e.g., QEDIT does
  237.                this in its most common configuration of Tab Expansion ON),
  238.                make sure that the physical tabs are set at 4 spaces.  If
  239.                they are set at higher or lower values, you'll end up larger
  240.                or smaller indentations than you expected.
  241.  
  242.           9)   Do NOT use the "{" and "}" characters in any way other
  243.            than to enclose a macro or keystroke command within the
  244.            macro source code.  The compiler assumes that all
  245.            occurrences of these characters are meant to enclose
  246.            commands and will generate an error and terminate
  247.            compilation if they occur without enclosing commands.
  248.            This is the only difference from WordPerfect's internal
  249.            macro editor, which allows you to use these French braces
  250.            as characters having nothing to do with commands.
  251.            You can, however, enter non-command related braces
  252.            in character code form.    Specifically, you can insert
  253.            literal braces anywhere in a macro by using the following
  254.            codes:
  255.                  "{" = [:0,123]
  256.                  "}" = [:0,125]
  257.  
  258.          10)   A violation of any of these syntax rules or the
  259.                occurrence of an illegal or misspelled command will
  260.                cause MCompile to issue an error message and halt
  261.                execution.  It also assigns a value from 11 to 17
  262.                to the DOS Errorlevel variable to designate the
  263.                occurrence of a particular error.  Checking
  264.                Errorlevel is a useful way of checking the
  265.                compilation process when MCompile is executed
  266.                within a batch file.
  267.  
  268.      C.   Once a source file is ready for compiling, the actual
  269.           compilation process is invoked by the following command:
  270.  
  271.               MCompile macro(.lst)
  272.  
  273.       Note that the name of the source file on the MCompile
  274.           command line may exclude the .lst extension, but will
  275.           accept the name with this extension if it is given. 
  276.           MCompile assumes that any source file has the .lst
  277.           extension, but this assumption may be overridden by
  278.           explicitly specifying a different extension.
  279.  
  280.      D.   If for some reason the compilation fails and a macro of
  281.           that name previously existed, the prior version of the
  282.           macro will be preserved.
  283.  
  284. 6.   Technical support:
  285.  
  286.      Free technical support will be furnished to any licensed user
  287.      who calls on weekdays during the hours from 9:00 a.m. to 5:00 p.m.
  288.      (Eastern) at the following number:  (919) 643-3492
  289.  
  290.      We may also be reached by mail at:
  291.  
  292.      Performance Sciences International
  293.      Suite 1250
  294.      3001 Latta Drive
  295.      Summerfield, NC  27358
  296.